from selenium import webdriver
from selenium.webdriver.chrome.service import Service

# 配置 Chrome 驱动
service = Service(executable_path='./chromedriver')
driver = webdriver.Chrome(service=service)

# 打开网页
driver.get("https://www.baidu.com")

# 获取页面标题
print("当前页面标题:", driver.title)

# 关闭浏览器
driver.quit()